m = eval(input("请输入m:"))
n = eval(input("请输入n:"))
print(m%n)